//类可以理解为模板，通过模板可以是实现实例化对象
//面向对象的编程思想
(() => {
    class Person {
        name: string
        age: number
        gender: string

        constructor(name: string='小明', age: number = 15, gender: string ='男') {
            this.name = name
            this.age = age
            this.gender = gender
        }

        cos(str:string){
            console.log(`大家好我叫${this.name},今年${this.age}岁,是个${this.gender}的,`,str)
        }
    }

    const person=new Person('佐助',18,'男')
    person.cos('我来自日本')

})()